<link rel="stylesheet" href="{$Think.ADMIN_SITE_ROOT}/css/admin.css">

<div class="page">
    <table class="ds-default-table">
        <thead>
        <tr>
            <th>{$Think.lang.article_sort}</th>
            <th>{$Think.lang.article_title}</th>
            <th>{$Think.lang.article_cate}</th>
            <th>{$Think.lang.article_show}</th>
            <th>{$Think.lang.article_time}</th>
            <th>{$Think.lang.ds_handle}</th>
        </tr>
        </thead>
        <tbody>
        {notempty name="article_list"}
        {foreach name="article_list" item="article"}
        <tr id="ds_row_{$article.article_id}">
            <td>{$article.article_sort}</td>
            <td>{$article.article_title}</td>
            <td>{$article.ac_name|default=''}</td>
            <td>{if $article.article_show eq '1'}{$Think.lang.ds_yes}{else}{$Think.lang.ds_no}{/if}</td>
            <td>{$article.article_time}</td>
            <td data-article_id="{$article.article_id}"
                data-article_title="{$article.article_title}"
                data-ac_name="{$article.ac_name|default=''}"
                data-article_time="{$article.article_time}"
                >
                <a href="JavaScript:void(0);" class="dssc-btn-mini dssc-btn-green" onclick="bundling_article_add($(this))"><i class="iconfont">&#xe6db;</i>关联此文章</a>
            </td>
        </tr>
        {/foreach}
        {else /}
        <tr class="no_data">
            <td colspan="10">{$Think.lang.ds_no_record}</td>
        </tr>
        {/notempty}
        </tbody>
    </table>
    {$show_page}
</div>
<script src="{$Think.PLUGINS_SITE_ROOT}/jquery-2.1.4.min.js"></script>
<script src="{$Think.PLUGINS_SITE_ROOT}/jquery.ajaxContent.pack.js"></script>

<script>
    function  bundling_article_add(o) {
        var _bundling_article_data = $('.bundling_article_data');
        debugger
//        eval('var _data = ' + o.parent().attr('data-param'));
        var article_id = o.parent().attr('data-article_id')
        var article_title = o.parent().attr('data-article_title')
        var html = "<a target='_blank' href='/index.php/home/article/show/article_id/"+ article_id +"' style='font-size: 16px'>"+article_title+"</a><input type='hidden' name='article_id' value='"+article_id+"'>";
        _bundling_article_data.html(html)
    }
</script>